﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Diablo3.Services.BattleNet
{
    /// <summary>
    /// This class represents a Battle Tag
    /// </summary>
    public class BattleTag
    {
        #region Properties

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the code.
        /// </summary>
        /// <value>
        /// The code.
        /// </value>
        public short Code { get; set; }

        /// <summary>
        /// Gets or sets the region.
        /// </summary>
        /// <value>
        /// The region.
        /// </value>
        public Region Region { get; set; }

        /// <summary>
        /// Gets or sets the culture.
        /// </summary>
        /// <value>
        /// The culture.
        /// </value>
        public CultureInfo Culture { get; set; }

        #endregion

        #region Ctor

        /// <summary>
        /// Initializes a new instance of the <see cref="BattleTag" /> class.
        /// </summary>
        public BattleTag()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="BattleTag" /> class. 
        /// The Culture will be set to en-US by default.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="code">The code.</param>
        /// <param name="region">The region.</param>
        public BattleTag(string name, short code, Region region)
        {
            this.Name = name;
            this.Code = code;
            this.Region = region;
            this.Culture = CultureInfo.GetCultureInfoByIetfLanguageTag("en-US");
        }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="BattleTag" /> class. 
        /// The Culture will be set to en-US by default.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="code">The code.</param>
        /// <param name="region">The region.</param>
        public BattleTag(string name, short code, Region region, string ietfLanguageTag)
        {
            this.Name = name;
            this.Code = code;
            this.Region = region;
            this.Culture = CultureInfo.GetCultureInfoByIetfLanguageTag(ietfLanguageTag);
        }

        #endregion
    }
}
